//
//  LoginViewController.h
//  FuelLog
//
//  Created by Pure Mass Communications on 2/22/09.
//  Copyright 2009 . All rights reserved.
//
//  Placed under GPL v2 with the kind permission of Pure Mass Communications
//
//  Modified to make compile under SDK 3.1 by Olaf Greck in May 2010
//
//
//  This program is free software; you can redistribute it and/or
//  modify it under the terms of the GNU General Public License
//  as published by the Free Software Foundation; either version 2
//  of the License, or (at your option) any later version.

//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.

//  You should have received a copy of the GNU General Public License
//  along with this program; if not, write to the Free Software
//  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

#import <UIKit/UIKit.h>
#import "GDataEntryFolderDoc.h"
#import "GdataDocs.h"
#import "GDataSpreadsheet.h"
#import "Car.h"
#import "KeychainItemWrapper.h"

@class GDataServiceTicket;

enum {
	FUELLOG_IMPORT,
	FUELLOG_EXPORT
};

@interface LoginViewController : UIViewController <UIAlertViewDelegate> {
	IBOutlet UITextField *usernameBox;
	IBOutlet UITextField *passwordBox;
	IBOutlet GradientButton *loginButton;
	IBOutlet UISwitch *saveSwitch;
	UIAlertView
//	CustomAlert 
	*alertView;
	
	KeychainItemWrapper *pwWrapper;
	
	GDataServiceGoogleSpreadsheet *spreadsheetService;
	GDataServiceGoogleDocs *docService;
	GDataServiceTicket *ticket;
	BOOL cancelled;
	
	int mode;
	BOOL creatingFolder;
	GDataEntryFolderDoc *folder;
	NSURL *folderPostURL;
	Car *car;
	NSArray *files;
	NSString *filename;
	BOOL success;
}

@property (nonatomic, assign) int mode;
@property (nonatomic, assign) Car *car;
@property (nonatomic, retain) IBOutlet GradientButton *loginButton;


- (IBAction)login:(id)sender;
- (IBAction)cancel:(id)sender;

@end
